package com.example.facility.controller.admin.user;

import com.example.facility.common.CommonResult;
import com.example.facility.controller.admin.user.vo.UserRespVO;
import com.example.facility.service.user.UserService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

import static com.example.facility.common.CommonResult.success;

@RestController
@RequestMapping("/user/user")
@Validated
@CrossOrigin
public class UserController {

    @Resource
    private UserService userService;

    /**
     * 获得用户管理列表
     *
     * @return
     */

    @GetMapping("/list")
    public CommonResult<List<UserRespVO>> getUserList() {
        return success(userService.getUserList());
    }


}